package com.study.design.iterator;

/**
 * @Author 网易云课堂微专业-java高级开发工程师【allen老师】
 * @Version 1.0
 */
public class Client {

    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf();
        bookShelf.appendBook(new Book("网易微专业Java架构师"));
        bookShelf.appendBook(new Book("大保健攻略"));
        bookShelf.appendBook(new Book("富婆通讯录"));
        bookShelf.appendBook(new Book("如何成为百万富翁"));
        Iterator it = bookShelf.iterator();
        while (it.hasNext()) {
            Book book = (Book) it.next();
            System.out.println(book.getName());
        }
    }
}

